package cheesymock;

import java.lang.reflect.*;

/**
 * A validator gets a callback upon creation of a mock object and on
 * every method call. The validator is free to throw exceptions at any
 * time. Several validators can be chained together by the driver.
 *
 * @author fredrik
 */
public abstract class Validator {
	protected Class<?> interfaceToImplement;
	protected Object delegate;
    
	public void creation(Class<?> interfaceToImplement, Object delegate) {
		this.interfaceToImplement = interfaceToImplement;
		this.delegate = delegate;
	}

	/**
	 * Called on each invocation of a given method. 
	 */
	public void invocation(Method method, Object[] arguments) {
	}

	/**
	 * The driver can call check() on each Validator to see if it's in
	 * a consistent state. The validator is free to throw exceptions.
	 */
	public void check() {
	}

}